Struct KeyValuePair<K,V>

An entry in a dictionary from K to V.

Implements

System.IEquatable<KeyValuePair<K,V>>, System.IFormattable, IShowable

Bases

object, System.ValueType

Field overview

Key ,
Value

Constructor overview

KeyValuePair<K,V>(K key, V value) ,
KeyValuePair<K,V>(K key)

Method overview

Equals(object obj) ,
Equals(KeyValuePair<K,V> other) ,
Finalize(), Inherited from object ,
GetHashCode() ,
GetType(), Inherited from object ,
MemberwiseClone(), Inherited from object ,
Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider) ,
ToString() ,
ToString(string format, System.IFormatProvider formatProvider)

Operator overview

operator !=(KeyValuePair<K,V> pair1, KeyValuePair<K,V> pair2) ,
operator ==(KeyValuePair<K,V> pair1, KeyValuePair<K,V> pair2)

Field details

K Key The key field of the entry
V Value The value field of the entry

Constructor details

KeyValuePair<K,V>(K key, V value) Create an entry with specified key and value
Parameters:
key:The key
value:The value
KeyValuePair<K,V>(K key) Create an entry with a specified key. The value will be the default value of type V.
Parameters:
key:The key

Method details

bool Equals(object obj) Check equality of entries.
Returns:True if obj is an entry of the same type and has the same key and value
Parameters:
obj:The other object
F bool Equals(KeyValuePair<K,V> other)
Returns:
Parameters:
other:
int GetHashCode() Get the hash code of the pair.
Returns:The hash code
F bool Show(System.Text.StringBuilder stringbuilder, ref int rest, System.IFormatProvider formatProvider)
Returns:
Parameters:
stringbuilder:
formatProvider:
rest:
string ToString() Pretty print an entry
Returns:(key, value)
F string ToString(string format, System.IFormatProvider formatProvider)
Returns:
Parameters:
format:
formatProvider:

Operator details

S bool operator !=(KeyValuePair<K,V> pair1, KeyValuePair<K,V> pair2)
Returns:
Parameters:
pair1:
pair2:
S bool operator ==(KeyValuePair<K,V> pair1, KeyValuePair<K,V> pair2)
Returns:
Parameters:
pair1:
pair2: